/*
* @Author: dengjiayao
* @Date:   2017-06-26 09:05:10
 * @Last Modified by: songwh
 * @Last Modified time: 2018-04-24 16:40:40
*/
import moment from 'moment'
import Vue from '../vue'
import store from '../vuex/store'
import { alert } from 'vue-strap'
import loginCheck from '../util/login-check'

import ItemList from './item-list/item-list.vue'
import ItemConfig from './item-config/item-config.vue'

new Vue({
  el: 'body',
  components: {
    'vue-alert-msg': alert,
    'vue-item-list': ItemList,
    'vue-item-config': ItemConfig
  },
  store,
  created() {
    loginCheck(this)
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  },
  methods: {
    newItem() {
      let startDate = moment().format('YYYY-MM-DD')
      var ref = this.$refs.itemConfig
      ref.voicePicUrl = ''
      ref.form = {
        pubDate: '',
        title: '',
        tags: '',
        newVoiceInfoDtos: [{
          duration: '',
          isQA: '1',
          voiceDetail: '',
          voicePicUrl: '',
          voiceTitle: '',
          voiceUrl: ''
        }],
        voiceTotalSecond: '',
        voiceTypeId: '',
        
        speaker: '',
        introduction: '',

        meetingPith: '',
        securitiesViewpoint: '',
        guestQA: '',
        buyerQA:'',
        
        buyerQAId: '',
        voiceTotalSize: '',
        performances: [],
        time:{
          hour: '',
          min: '',
          sec: ''
        }

      }
      ref.showModal = true
    }
  }
})
